/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("Advertisement",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using VOL.QiXing.IServices;
<<<<<<< HEAD
using Microsoft.AspNetCore.Authorization;
using VOL.Core.ObjectActionValidator;
=======
>>>>>>> ada1b5a63ea1d243550ff89ba9cc243cba8ab73f

namespace VOL.QiXing.Controllers
{
    public partial class AdvertisementController
    {
        private readonly IAdvertisementService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public AdvertisementController(
            IAdvertisementService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }
<<<<<<< HEAD

        [HttpPost, HttpGet, Route("AddAdvertisement"), AllowAnonymous]
        [ObjectModelValidatorFilter(ValidatorModel.Login)]
        public async Task<IActionResult> AddAdvertisement([FromBody] Advertisement advertisement)
        {
            return Json(await Service.AddAdvertisement(advertisement));
        }

=======
>>>>>>> ada1b5a63ea1d243550ff89ba9cc243cba8ab73f
    }
}
